package com.easy.frame.common.process.core.emum;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 审核类型枚举
 *
 * @author zzf
 */
@Getter
@AllArgsConstructor
public enum ExamineTypeEnum {

    /**
     * 取决于用户对象的字段值
     */
    USER_FIELD(1),

    /**
     * 取决于绑定对象的字段值
     */
    TARGET_FIELD(2),

    /**
     * 取决于触发事件的返回值
     */
    TRIGGER_EVENT(3);

    private final int type;


    public static ExamineTypeEnum getByType(int type) {
        for (ExamineTypeEnum targetTypeEnum : ExamineTypeEnum.values()) {
            if (targetTypeEnum.getType() == type) {
                return targetTypeEnum;
            }
        }
        return null;
    }


}
